﻿@page "{channelindex?}"
@using Cybertron.Tag
@using Cybertron.Tag.Model
@inject Cybertron.Tag.ICmsTag cms
@{
    string _channelindex = RouteData.Values["channelindex"].ToString();
    int siteid = (int)ViewBag.SiteId;
    var channel = cms.channel.get(_channelindex, siteid);
    var subs = new List<channelmod>();
    subs = cms.channel.get_list(m => m.ParentId == channel.id);
    int page = 1, size = 20;
    int totalpage = 1, totalcount = 0;
    page = cms.query_int("page") ?? 1;
    size = channel.pagesize;
    var articles = cms.content.pager_by_channelid(page, size, channel.id, out totalpage, out totalcount, siteid);
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Pragma" content="no-cache">
    <title>@Html.Raw(string.IsNullOrEmpty(channel.seo_description)?channel.name:channel.seo_description)</title>
    <meta name="keywords" content="@channel.seo_keywords" />
    <meta name="description" content="@channel.seo_description" />
    <link rel="stylesheet" type="text/css" href="/templates/hongyuan/css/index.min.css" />
</head>
<body>
    <div class="m-head">
        <a href="/" class="u-logo"></a>
        <div class="u-menu">
            <span></span>
            <b></b>
        </div>
        <div class="u-language">
            <a href="/">中</a><b>·</b><a href="/en">EN</a>
        </div>
        @Html.Partial("include/search",0)
    </div>
    <div class="u-search-box">
        @Html.Partial("include/msearch",0)
    </div>
    @Html.Partial("include/nav",0)
    <div class="m-banner">
        <img src="@channel.ext1" alt="" class="pc-banner">
        <img src="@channel.ext2" alt="" class="mib-banner">
        <img src="@channel.ext3" alt="" class="banner-text">
    </div>
    <div class="m-crumbs">
        <a href="/">Home</a>
        <b>·</b>
        <a href="javascript:;">About Us</a>
        <b>·</b>
        <a href="javascript:;" class="z-current">@channel.name</a>
    </div>
    <div class="m-news">
        <div class="news-tab">
            @{ 

                foreach (var sub in subs) {
                    string letter = "";
                    if (sub.channelindex == _channelindex) {
                        letter = "z-current";
                    }
                    <a href="@sub.url[0]" class="@letter">
                        <div class="news-title">
                            <i class="iconfont icon-xinwen"></i>
                            <b>@sub.name</b>
                        </div>
                    </a>
                }
            }
        </div>
        <div class="news-list">
            <ul>
                @{ 
                    foreach (var c in articles) {
                        <li>
                            <a href="javascript:;">
                                <img src="@c.picture" alt="">
                                <div class="news-text">
                                    <h2>@c.title</h2>
                                    <p>@Html.Raw(this.cms.htmltotext(c.summary))</p>
                                    @*<span class="news-time">@c.addtime.ToString("yyyy/MM/dd")</span>
                                    <b class="news-more">MORE</b>*@
                                </div>
                            </a>
                        </li>
                    }
                }
            </ul>
            <div class="m-pages">
                @Html.Raw(cms.page( page, channel.pagesize, totalpage, totalcount,new Dictionary<string, string>
                    { }))
            </div>
        </div>
    </div>
    @Html.Partial("include/foot",0)
    <script src="/templates/hongyuan/js/all.min.js" type="text/javascript" charset="utf-8"></script>
    <script>(function($) {
            window.scrollReveal = new scrollReveal({
                enter: 'bottom',
                after: '0.3s',
                reset: false,
                move: '100px'
            });
})();</script>
</body>
</html>

